#pragma once

class CResourceLoadCallbackIdentify;
class IResourceLoadCallback
{
public:
	virtual void didIdentifierURL(CResourceLoadCallbackIdentify &callback, LPCWSTR url) = 0;
	virtual void didReceiveData(CResourceLoadCallbackIdentify &callback,
		const unsigned char* data, UINT dataLength, UINT encodedDataLength) = 0;
	virtual void didFinishLoadingFromDataSource(CResourceLoadCallbackIdentify &callback) = 0;
	virtual void didFailLoadingWithError(CResourceLoadCallbackIdentify &callback, LPCWSTR description) = 0;
};

class CResourceLoadCallbackIdentify
{
public:
	IResourceLoadCallback *m_caller;
	CString m_callbackStr;
	LPVOID m_identify;
	bool m_callbackOnce;

	CResourceLoadCallbackIdentify() :m_caller(nullptr), m_identify(nullptr), m_callbackOnce(true) {}
	CResourceLoadCallbackIdentify(IResourceLoadCallback *caller, LPCWSTR idURL, LPVOID identify, bool callbackOnce = true)
		:m_caller(caller), m_callbackStr(idURL), m_identify(identify), m_callbackOnce(callbackOnce) {}
};
